Squeegee out a few more explicit references to the microseconds member.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 Jul 2013 04:54:18 +0000 (04:54 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 Jul 2013 04:54:18 +0000 (04:54 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4449 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/cetus.cc
gpsbabel/gdb.cc
gpsbabel/ggv_log.cc
gpsbabel/navilink.cc
gpsbabel/sbn.cc
gpsbabel/stmwpp.cc

index fc31bd5a9c58ae923844be242ea3101ebf67009b..cda0cca7d93784d70bc7f0207a823e8904eeb868 100644 (file)
@@ -211,10 +211,7 @@ read_track_point(cetus_track_point_t* data, const time_t basetime)
   }
 
   wpt->SetCreationTime(basetime +
-                       ((data->hour & 0x1F) * 3600) + (data->min * 60) + data->sec);
-  if (data->dsec) {
-    wpt->microseconds = (int)data->dsec * 10000;
-  }
+                       ((data->hour & 0x1F) * 3600) + (data->min * 60) + data->sec, (int)data->dsec * 10000);
 
   return wpt;
 }
index 8be4fb66c816cfc56844038a9af14048d24e83bc..a7047ef26b57bc19b3c3ca87a46c447200520265 100644 (file)
@@ -1308,7 +1308,7 @@ write_waypoint(
   memset(zbuf, 0, sizeof(zbuf));
   memset(ffbuf, 0xFF, sizeof(ffbuf));
 
-  wpt_class = wpt->microseconds;               /* trick */
+  wpt_class = wpt->wpt_flags.fmt_use;          /* trick */
 
   FWRITE_CSTR(shortname);                      /* uniqe (!!!) shortname */
   FWRITE_i32(wpt_class);                       /* waypoint class */
@@ -1503,7 +1503,7 @@ write_route(const route_head* rte, const char* rte_name)
     /* extra_data may contain a modified shortname */
     FWRITE_CSTR((wpt->extra_data) ? (char*)wpt->extra_data : wpt->shortname);
 
-    wpt_class = wpt->microseconds;                     /* trick */
+    wpt_class = wpt->wpt_flags.fmt_use;                        /* trick */
 
     FWRITE_i32(wpt_class);                             /* waypoint class */
     FWRITE_CSTR(GMSD_GET(cc, ""));                     /* country */
@@ -1681,7 +1681,7 @@ write_waypoint_cb(const waypoint* refpt)
     if (wpt_class == -1) {
       wpt_class = (route_flag) ? GDB_DEF_HIDDEN_CLASS : GDB_DEF_CLASS;
     }
-    wpt->microseconds = wpt_class;     /* trick, we need this for the route(s) */
+    wpt->wpt_flags.fmt_use = wpt_class;        /* trick, we need this for the route(s) */
 
     icon = GMSD_GET(icon, -1);
     if (icon < 0) {
index c2a3572e8b819a25ee73083bc47eb06c479d1a41..5b385c54e8ab2707ec48d7a55b0f827357e0d990 100644 (file)
@@ -139,7 +139,7 @@ ggv_log_read(void)
     wpt->longitude = xlon;
 
     WAYPT_SET(wpt, course, le_read16(&buf[16 + 0]));
-
+    int microseconds = 0;
     if (ggv_log_ver == 10) {
       double secs;
 
@@ -152,7 +152,7 @@ ggv_log_read(void)
       tm.tm_min =     le_read16(&buf[16 + 16]);
       secs =          le_read_double(&buf[16 + 18]);
       tm.tm_sec = (int)secs;
-      wpt->microseconds = (secs - tm.tm_sec) * 1000000;
+      microseconds = (secs - tm.tm_sec) * 1000000;
     } else {
       wpt->altitude = le_read16(&buf[16 + 4]);
       wpt->sat = (unsigned char)buf[16 + 14];
@@ -179,7 +179,7 @@ ggv_log_read(void)
       tm.tm_year -= 1900;
       if (tm.tm_mon > 0) {
         tm.tm_mon--;
-        wpt->SetCreationTime(mkgmtime(&tm));
+        wpt->SetCreationTime(mkgmtime(&tm), microseconds);
       }
     }
 
index 562cd18ede68877801fb2e863b1f6540e335ad32..cba283ae96cc45bb84540c7cc8fdc46e7447d3d7 100644 (file)
@@ -851,8 +851,8 @@ navilink_decode_logpoint(const unsigned char* buffer)
 
   waypt->hdop = ((unsigned char)buffer[0]) * 0.2f;
   waypt->sat = buffer[1];
-  waypt->microseconds = decode_sbp_usec(buffer + 2);
-  waypt->SetCreationTime(decode_sbp_datetime_packed(buffer + 4));
+  waypt->SetCreationTime(decode_sbp_datetime_packed(buffer + 4),
+                         decode_sbp_usec(buffer + 2));
   decode_sbp_position(buffer + 12, waypt);
   WAYPT_SET(waypt, speed, le_read16(buffer + 24) * 0.01f);
   WAYPT_SET(waypt, course, le_read16(buffer + 26) * 0.01f);
index 7d57a21c2f51729b81c8b23e667a96faad70e73f..ea524db9da64816149d5cdd9f6d4d006cadfae07 100644 (file)
@@ -225,8 +225,7 @@ decode_sbn_datetime(const unsigned char *buffer, waypoint *waypt)
   tm.tm_mon = buffer[2] - 1;
   tm.tm_year = be_readu16(buffer) - 1900;
 
-  waypt->SetCreationTime(mkgmtime(&tm));
-  waypt->microseconds = (ms % 1000) * 1000;
+  waypt->SetCreationTime(mkgmtime(&tm), (ms % 1000) * 1000);
 }
 
 static void
index 8d627352d19f80e7da54f63dd0f0bdc06924a2fc..291266137687d777faf167c4c6b14eb02c39999f 100644 (file)
@@ -103,6 +103,7 @@ stmwpp_data_read(void)
 
     wpt = NULL;
     memset(&time, 0, sizeof(time));
+    int microseconds = 0;
 
     while ((c = csv_lineparse(buff, ",", "", column++))) {
       int new_what;
@@ -152,10 +153,10 @@ stmwpp_data_read(void)
 
       case 6:
         sscanf(c, "%d:%d:%d.%d", &time.tm_hour, &time.tm_min, &time.tm_sec, &fracsec);
-        wpt->microseconds = MILLI_TO_MICRO(fracsec);
+        microseconds = MILLI_TO_MICRO(fracsec);
         /* makes sense only for recorded trackpoints */
         if (what != STM_TRKPT) {
-          wpt->microseconds = 0;
+          microseconds = 0;
         }
         break;
 
@@ -166,7 +167,7 @@ stmwpp_data_read(void)
     if (wpt != NULL) {
       time.tm_year -= 1900;
       time.tm_mon--;
-      wpt->SetCreationTime(mkgmtime(&time));
+      wpt->SetCreationTime(mkgmtime(&time), microseconds);
 
       switch (what) {
       case STM_WAYPT: